package com.iweb.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.ArrayList;
import java.util.List;

/**
 * 南京艾瑞
 * 作者: jack
 * 时间: 2020-06-29 14:37
 * 描述: UserController
 */
@Controller
public class UserController {
    @GetMapping("hello")
    public ModelAndView hello(String name, Model model) {
        System.out.println(name);
        // 模拟一个list返回页面
        List<String> list = new ArrayList<>();
        list.add("AA");
        list.add("BB");
        list.add("CC");
        model.addAttribute("list", list);
        return new ModelAndView("success", "model", model);
    }
}
